package com.yilin.tms.core.entity.truck;


import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yilin.tms.core.commons.base.BaseDataEntity;
import com.yilin.tms.core.commons.model.AuthStatus;
import com.yilin.tms.core.entity.gps.VehicleGps;
import com.yilin.tms.core.entity.gps.hyb.EquipmentInfo;
import com.yilin.tms.core.entity.system.param.TruckType;
import com.yilin.tms.core.entity.user.organize.Organize;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;


/**
 * 车辆实体类
 *
 * @author zhangjinyuan
 * @date 2022/10/24
 */
@Entity
@Table(name = "truck_vehicle")
@TableName(value = "truck_vehicle")
public class TruckVehicle extends BaseDataEntity {

    /**
     * 车辆状态
     */
    public enum TruckStatus {
        auth(0, "认证中"),
        unused(1, "空闲中"),
        using(2, "忙碌中"),
        repair(3, " 已损坏（维护中）");
        @EnumValue
        public Integer index;
        public String name;

        TruckStatus(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }

    /**
     * ETC状态
     */
    public enum EtcKeepStatus {
        none(0, "未备案"),
        keep(1, "已备案"),
        keepFill(2, "备案失败");//失败三次
        @EnumValue
        public Integer index;
        public String name;

        EtcKeepStatus(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }

    /**
     * 省运管 车辆信息单 创建状态
     */
    public enum TmsTruckDataState {
        needless(0, "无需创建"),
        wait(1, "等待创建"),
        creating(2, "创建中"),
        success(3, "创建成功"),
        error(4, "创建失败");
        @EnumValue
        public Integer index;
        public String name;

        TmsTruckDataState(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }

    /**
     * 车主(组织)信息
     */
    @Column(name = "organize_id")
    private String organizeId;
    @Column(name = "organize_name")
    private String organizeName;
    @Column(name = "organize_logo")
    private String organizeLogo;
    @Column(name = "organize_monthly_rating")
    private Double organizeMonthlyRating;
    @Column(name = "organize_member_type_name")
    private String organizeMemberTypeName;
    @Column(name = "manage_user_id")
    private String manageUserId;//管理员
    @Column(name = "manage_user_name")
    private String manageUserName; //管理员名称
    @Column(name = "manage_user_avatar")
    private String manageUserAvatar; //管理员头像
    @Column(name = "manage_user_phone")
    private String manageUserPhone; //管理员电话

    public void setAdvanceMoney(Double advanceMoney) {
        this.advanceMoney = advanceMoney;
    }

    @Column(name = "advance_money")
    private Double advanceMoney=0d; //预支金额
    @Column(name = "oill_money")
    private Double oillMoney=0d; //油费
    @Column(name = "oill_integral")
    private Double oillIntegral=0d; //油卡积分
    /**
     * 司机-驾驶员信息
     */
    @Column(name = "truck_user_id")
    private String truckUserId;//驾驶员ID
    @Column(name = "truck_user_name")
    private String truckUserName;//驾驶员名称
    @Column(name = "truck_user_avatar")
    private String truckUserAvatar;//驾驶员头像
    @Column(name = "truck_user_phone")
    private String truckUserPhone;//驾驶员电话
    /**
     * 车辆基础数据
     */
    @Column(name = "tractor_no")
    private String tractorNo;//(挂车专属)临时牵引车头 车牌号 为空表示闲置
    @Column(name = "truck_status", columnDefinition = "int default 0")
    private TruckStatus truckStatus;//默认设置车辆状态
    @Column(name = "etc_keep_status", columnDefinition = "int default 0")
    private EtcKeepStatus etcKeepStatus;//ETC车辆备案
    @Column(name = "etc_keep_count")
    private Integer etcKeepCount = 0;
    @Column(name = "tms_truck_data_state")
    private TmsTruckDataState tmsTruckDataState; //省运管 车辆信息单 提交状态
    @Column(name = "vehicle_long")
    private Double vehicleLong; //车长
    @Column(name = "vehicle_height")
    private Double vehicleHeight;//车高
    @Column(name = "vehicle_width")
    private Double vehicleWidth; //车宽
    @Column(name = "vehicle_axes_num")
    private Double vehicleAxesNum; //轴数
    @Column(name = "vehicle_weight")
    private Double vehicleWeight; //车辆总质量
    @Column(name = "loading_weight")
    private Double loadingWeight;//车辆载重
    @Column(name = "vehicle_image_url", columnDefinition = "TEXT")
    private String vehicleImageUrl;//车辆图片
    /**
     * 专业车辆类型
     */
    @Column(name = "truck_type_id")
    private String truckTypeId; //车辆类型ID
    @Column(name = "truck_type_towing_type")
    private TruckType.TowingType truckTypeTowingType;//车辆类型 普通车/牵引车/挂车类型
    @Column(name = "truck_type_code")
    private String truckTypeCode;//车辆类型Code
    @Column(name = "truck_type_name")
    private String truckTypeName;//车辆类型Name
    @Column(name = "truck_type_level")
    private Integer truckTypeLevel;//车辆类型等级
    @Column(name = "truck_type_remark")
    private String truckTypeRemark; //车辆类型备注
    /**
     * 通用车辆类型
     */
    @Column(name = "comm_truck_type_id")
    private String commTruckTypeId;//公共车辆类型ID
    @Column(name = "comm_truck_type_name")
    private String commTruckTypeName;//公共车辆类型Name
    @Column(name = "comm_truck_type_match_rank")
    private Integer commTruckTypeMatchRank; //公共车辆类型抢单级别
    @Column(name = "comm_truck_type_is_trailer")
    private TruckType.IsTrailer commTruckTypeIsTrailer;//是否挂车 不含牵引车
    @Column(name = "comm_truck_type_img", columnDefinition = "TEXT")
    private String commTruckTypeImg; //公共车型图片
    @Column(name = "comm_truck_type3d_path")
    private String commTruckType3dPath; //公共车型3D模型
    @Column(name = "comm_truck_type_remark")
    private String commTruckTypeRemark; //公共车型备注
    @Column(name = "comm_truck_type_height_scope")
    private String commTruckTypeHeightScope;//公共车型车高范围
    @Column(name = "comm_truck_type_long_scope")
    private String commTruckTypeLongScope;//公共车型车长范围
    @Column(name = "comm_truck_type_width_scope")
    private String commTruckTypeWidthScope;//公共车型车宽范围
    @Column(name = "comm_truck_type_load_volume_scope")
    private String commTruckTypeLoadVolumeScope;//公共车型载方范围
    @Column(name = "comm_truck_type_load_weight_scope")
    private String commTruckTypeLoadWeightScope;//公共车型载重范围
    /**
     * 车牌信息
     */
    @Column(name = "track_no")
    private String trackNo; //车牌号
    @Column(name = "card_plate_id")
    private String cardPlateId;//车牌颜色ID
    @Column(name = "card_plate_code")
    private String cardPlateCode;//车牌颜色Code
    @Column(name = "card_plate_name")
    private String cardPlateName;//车牌颜色名称
    /**
     * 能源类型
     */
    @Column(name = "truck_energy_type_id")
    private String truckEnergyTypeId; //能源类型ID
    @Column(name = "truck_energy_type_code")
    private String truckEnergyTypeCode;//能源类型Code
    @Column(name = "truck_energy_type_name")
    private String truckEnergyTypeName;//能源类型名称
    /**
     * GPS
     */
    @Column(name = "truck_gps_type")
    private VehicleGps.TruckGpsType truckGpsType;//车辆GPS类型
    @Column(name = "sim_card_id") //sim卡id号
    private String simCardId;
    @Column(name = "gps_device_id")
    private String gpsDeviceId;//gps设备id号
    @Column(name = "truck_position")
    private String truckPosition;//车辆位置
    @Column(name = "truck_address")
    private String truckAddress;  //车辆位置:贵阳市云岩区xxx
    /**
     * 查询字段
     */
    @Transient
    @TableField(exist = false)
    private AuthStatus authTravelLicenseStatus = AuthStatus.notApply; //行驶证
    @Transient
    @TableField(exist = false)
    private AuthStatus authTransportLicenseStatus = AuthStatus.notApply; //道路运输证
    @Transient
    @TableField(exist = false)
    private Organize vehicleOrganize;//车辆组织信息
    @Transient
    @TableField(exist = false)
    private  EquipmentInfo equipmentInfo;
    @Transient
    @TableField(exist = false)
    private String position; //登录用户当前定位 用于分页距离排序
    @Transient
    @TableField(exist = false)
    private Double distances; //查询用户与车辆位置距离
    @Transient
    @TableField(exist = false)
    private String vehicleDetailUrl;  //车源详情链接

    public Double getAdvanceMoney() {
        return advanceMoney;
    }

    public EquipmentInfo getEquipmentInfo() {
        return equipmentInfo;
    }

    public void setEquipmentInfo(EquipmentInfo equipmentInfo) {
        this.equipmentInfo = equipmentInfo;
    }

    public Integer getCommTruckTypeMatchRank() {
        return commTruckTypeMatchRank;
    }

    public void setCommTruckTypeMatchRank(Integer commTruckTypeMatchRank) {
        this.commTruckTypeMatchRank = commTruckTypeMatchRank;
    }

    public String getOrganizeId() {
        return organizeId;
    }

    public void setOrganizeId(String organizeId) {
        this.organizeId = organizeId;
    }

    public String getOrganizeName() {
        return organizeName;
    }

    public void setOrganizeName(String organizeName) {
        this.organizeName = organizeName;
    }

    public String getOrganizeLogo() {
        return organizeLogo;
    }

    public void setOrganizeLogo(String organizeLogo) {
        this.organizeLogo = organizeLogo;
    }

    public Double getOrganizeMonthlyRating() {
        return organizeMonthlyRating;
    }

    public void setOrganizeMonthlyRating(Double organizeMonthlyRating) {
        this.organizeMonthlyRating = organizeMonthlyRating;
    }

    public String getOrganizeMemberTypeName() {
        return organizeMemberTypeName;
    }

    public void setOrganizeMemberTypeName(String organizeMemberTypeName) {
        this.organizeMemberTypeName = organizeMemberTypeName;
    }

    public String getManageUserId() {
        return manageUserId;
    }

    public void setManageUserId(String manageUserId) {
        this.manageUserId = manageUserId;
    }

    public String getManageUserName() {
        return manageUserName;
    }

    public void setManageUserName(String manageUserName) {
        this.manageUserName = manageUserName;
    }

    public String getManageUserAvatar() {
        return manageUserAvatar;
    }

    public void setManageUserAvatar(String manageUserAvatar) {
        this.manageUserAvatar = manageUserAvatar;
    }

    public String getManageUserPhone() {
        return manageUserPhone;
    }

    public void setManageUserPhone(String manageUserPhone) {
        this.manageUserPhone = manageUserPhone;
    }

    public String getTruckUserId() {
        return truckUserId;
    }

    public void setTruckUserId(String truckUserId) {
        this.truckUserId = truckUserId;
    }

    public String getTruckUserName() {
        return truckUserName;
    }

    public void setTruckUserName(String truckUserName) {
        this.truckUserName = truckUserName;
    }

    public String getTruckUserAvatar() {
        return truckUserAvatar;
    }

    public void setTruckUserAvatar(String truckUserAvatar) {
        this.truckUserAvatar = truckUserAvatar;
    }

    public String getTruckUserPhone() {
        return truckUserPhone;
    }

    public void setTruckUserPhone(String truckUserPhone) {
        this.truckUserPhone = truckUserPhone;
    }

    public String getTractorNo() {
        return tractorNo;
    }

    public void setTractorNo(String tractorNo) {
        this.tractorNo = tractorNo;
    }

    public TruckStatus getTruckStatus() {
        return truckStatus;
    }

    public void setTruckStatus(TruckStatus truckStatus) {
        this.truckStatus = truckStatus;
    }

    public EtcKeepStatus getEtcKeepStatus() {
        return etcKeepStatus;
    }

    public void setEtcKeepStatus(EtcKeepStatus etcKeepStatus) {
        this.etcKeepStatus = etcKeepStatus;
    }

    public TmsTruckDataState getTmsTruckDataState() {
        return tmsTruckDataState;
    }

    public void setTmsTruckDataState(TmsTruckDataState tmsTruckDataState) {
        this.tmsTruckDataState = tmsTruckDataState;
    }

    public Double getVehicleLong() {
        return vehicleLong;
    }

    public void setVehicleLong(Double vehicleLong) {
        this.vehicleLong = vehicleLong;
    }

    public Double getVehicleHeight() {
        return vehicleHeight;
    }

    public void setVehicleHeight(Double vehicleHeight) {
        this.vehicleHeight = vehicleHeight;
    }

    public Double getVehicleWidth() {
        return vehicleWidth;
    }

    public void setVehicleWidth(Double vehicleWidth) {
        this.vehicleWidth = vehicleWidth;
    }

    public Double getVehicleAxesNum() {
        return vehicleAxesNum;
    }

    public void setVehicleAxesNum(Double vehicleAxesNum) {
        this.vehicleAxesNum = vehicleAxesNum;
    }

    public Double getVehicleWeight() {
        return vehicleWeight;
    }

    public void setVehicleWeight(Double vehicleWeight) {
        this.vehicleWeight = vehicleWeight;
    }

    public Double getLoadingWeight() {
        return loadingWeight;
    }

    public void setLoadingWeight(Double loadingWeight) {
        this.loadingWeight = loadingWeight;
    }

    public String getVehicleImageUrl() {
        return vehicleImageUrl;
    }

    public void setVehicleImageUrl(String vehicleImageUrl) {
        this.vehicleImageUrl = vehicleImageUrl;
    }

    public String getTruckTypeId() {
        return truckTypeId;
    }

    public void setTruckTypeId(String truckTypeId) {
        this.truckTypeId = truckTypeId;
    }

    public TruckType.TowingType getTruckTypeTowingType() {
        return truckTypeTowingType;
    }

    public void setTruckTypeTowingType(TruckType.TowingType truckTypeTowingType) {
        this.truckTypeTowingType = truckTypeTowingType;
    }

    public String getTruckTypeCode() {
        return truckTypeCode;
    }

    public void setTruckTypeCode(String truckTypeCode) {
        this.truckTypeCode = truckTypeCode;
    }

    public String getTruckTypeName() {
        return truckTypeName;
    }

    public void setTruckTypeName(String truckTypeName) {
        this.truckTypeName = truckTypeName;
    }

    public Integer getTruckTypeLevel() {
        return truckTypeLevel;
    }

    public void setTruckTypeLevel(Integer truckTypeLevel) {
        this.truckTypeLevel = truckTypeLevel;
    }

    public String getTruckTypeRemark() {
        return truckTypeRemark;
    }

    public void setTruckTypeRemark(String truckTypeRemark) {
        this.truckTypeRemark = truckTypeRemark;
    }

    public String getCommTruckTypeId() {
        return commTruckTypeId;
    }

    public void setCommTruckTypeId(String commTruckTypeId) {
        this.commTruckTypeId = commTruckTypeId;
    }

    public String getCommTruckTypeName() {
        return commTruckTypeName;
    }

    public void setCommTruckTypeName(String commTruckTypeName) {
        this.commTruckTypeName = commTruckTypeName;
    }

    public TruckType.IsTrailer getCommTruckTypeIsTrailer() {
        return commTruckTypeIsTrailer;
    }

    public void setCommTruckTypeIsTrailer(TruckType.IsTrailer commTruckTypeIsTrailer) {
        this.commTruckTypeIsTrailer = commTruckTypeIsTrailer;
    }

    public String getCommTruckTypeImg() {
        return commTruckTypeImg;
    }

    public void setCommTruckTypeImg(String commTruckTypeImg) {
        this.commTruckTypeImg = commTruckTypeImg;
    }

    public String getCommTruckType3dPath() {
        return commTruckType3dPath;
    }

    public void setCommTruckType3dPath(String commTruckType3dPath) {
        this.commTruckType3dPath = commTruckType3dPath;
    }

    public String getCommTruckTypeRemark() {
        return commTruckTypeRemark;
    }

    public void setCommTruckTypeRemark(String commTruckTypeRemark) {
        this.commTruckTypeRemark = commTruckTypeRemark;
    }

    public String getCommTruckTypeHeightScope() {
        return commTruckTypeHeightScope;
    }

    public void setCommTruckTypeHeightScope(String commTruckTypeHeightScope) {
        this.commTruckTypeHeightScope = commTruckTypeHeightScope;
    }

    public String getCommTruckTypeLongScope() {
        return commTruckTypeLongScope;
    }

    public void setCommTruckTypeLongScope(String commTruckTypeLongScope) {
        this.commTruckTypeLongScope = commTruckTypeLongScope;
    }

    public String getCommTruckTypeWidthScope() {
        return commTruckTypeWidthScope;
    }

    public void setCommTruckTypeWidthScope(String commTruckTypeWidthScope) {
        this.commTruckTypeWidthScope = commTruckTypeWidthScope;
    }

    public String getCommTruckTypeLoadVolumeScope() {
        return commTruckTypeLoadVolumeScope;
    }

    public void setCommTruckTypeLoadVolumeScope(String commTruckTypeLoadVolumeScope) {
        this.commTruckTypeLoadVolumeScope = commTruckTypeLoadVolumeScope;
    }

    public String getCommTruckTypeLoadWeightScope() {
        return commTruckTypeLoadWeightScope;
    }

    public void setCommTruckTypeLoadWeightScope(String commTruckTypeLoadWeightScope) {
        this.commTruckTypeLoadWeightScope = commTruckTypeLoadWeightScope;
    }

    public String getTrackNo() {
        return trackNo;
    }

    public void setTrackNo(String trackNo) {
        this.trackNo = trackNo;
    }

    public String getCardPlateId() {
        return cardPlateId;
    }

    public void setCardPlateId(String cardPlateId) {
        this.cardPlateId = cardPlateId;
    }

    public String getCardPlateCode() {
        return cardPlateCode;
    }

    public void setCardPlateCode(String cardPlateCode) {
        this.cardPlateCode = cardPlateCode;
    }

    public String getCardPlateName() {
        return cardPlateName;
    }

    public void setCardPlateName(String cardPlateName) {
        this.cardPlateName = cardPlateName;
    }

    public String getTruckEnergyTypeId() {
        return truckEnergyTypeId;
    }

    public void setTruckEnergyTypeId(String truckEnergyTypeId) {
        this.truckEnergyTypeId = truckEnergyTypeId;
    }

    public String getTruckEnergyTypeCode() {
        return truckEnergyTypeCode;
    }

    public void setTruckEnergyTypeCode(String truckEnergyTypeCode) {
        this.truckEnergyTypeCode = truckEnergyTypeCode;
    }

    public String getTruckEnergyTypeName() {
        return truckEnergyTypeName;
    }

    public void setTruckEnergyTypeName(String truckEnergyTypeName) {
        this.truckEnergyTypeName = truckEnergyTypeName;
    }

    public VehicleGps.TruckGpsType getTruckGpsType() {
        return truckGpsType;
    }

    public void setTruckGpsType(VehicleGps.TruckGpsType truckGpsType) {
        this.truckGpsType = truckGpsType;
    }

    public String getSimCardId() {
        return simCardId;
    }

    public void setSimCardId(String simCardId) {
        this.simCardId = simCardId;
    }

    public String getGpsDeviceId() {
        return gpsDeviceId;
    }

    public void setGpsDeviceId(String gpsDeviceId) {
        this.gpsDeviceId = gpsDeviceId;
    }

    public AuthStatus getAuthTravelLicenseStatus() {
        return authTravelLicenseStatus;
    }

    public void setAuthTravelLicenseStatus(AuthStatus authTravelLicenseStatus) {
        this.authTravelLicenseStatus = authTravelLicenseStatus;
    }

    public AuthStatus getAuthTransportLicenseStatus() {
        return authTransportLicenseStatus;
    }

    public void setAuthTransportLicenseStatus(AuthStatus authTransportLicenseStatus) {
        this.authTransportLicenseStatus = authTransportLicenseStatus;
    }

    public Organize getVehicleOrganize() {
        return vehicleOrganize;
    }

    public void setVehicleOrganize(Organize vehicleOrganize) {
        this.vehicleOrganize = vehicleOrganize;
    }

    public String getTruckPosition() {
        return truckPosition;
    }

    public void setTruckPosition(String truckPosition) {
        this.truckPosition = truckPosition;
    }

    public String getTruckAddress() {
        return truckAddress;
    }

    public void setTruckAddress(String truckAddress) {
        this.truckAddress = truckAddress;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public Double getDistances() {
        return distances;
    }

    public void setDistances(Double distances) {
        this.distances = distances;
    }

    public String getVehicleDetailUrl() {
        return vehicleDetailUrl;
    }

    public void setVehicleDetailUrl(String vehicleDetailUrl) {
        this.vehicleDetailUrl = vehicleDetailUrl;
    }

    public Integer getEtcKeepCount() {
        return etcKeepCount;
    }

    public void setEtcKeepCount(Integer etcKeepCount) {
        this.etcKeepCount = etcKeepCount;
    }

    public Double getOillMoney() {
        return oillMoney;
    }

    public void setOillMoney(Double oillMoney) {
        this.oillMoney = oillMoney;
    }

    public Double getOillIntegral() {
        return oillIntegral;
    }

    public void setOillIntegral(Double oillIntegral) {
        this.oillIntegral = oillIntegral;
    }
}
